<!--{eval 
	$_TPL['formtypes'] = array('text'=>'文本输入', 'select'=>'单选列表', 'multi'=>'多选列表');
}-->
<!--{template admin/tpl/header}-->

<div class="mainarea">
<div class="maininner">

<div class="tabs_header">
	<ul class="tabs">
		<li$actives[view]><a href="admincp.php?ac=profield"><span>浏览栏目</span></a></li>
		<li class="null"><a href="admincp.php?ac=profield&op=add">添加新群组栏目</a></li>
	</ul>
</div>

<!--{if $_GET['op'] == 'delete'}-->
	<form method="post" action="admincp.php?ac=profield&op=delete&fieldid=$_GET[fieldid]">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">
	<div class="topactions">
		该栏目删除后，请选择该栏目下面已有的群组会归类到那个新栏目。
	</div>
	<table cellspacing="0" cellpadding="0" class="formtable">
	<tr>
		<th width="150">栏目下的群组新归类</th>
		<td>
		<select name="newfieldid">
		<!--{loop $newfield $value}-->
		<option value="$value[fieldid]">$value[title]</option>
		<!--{/loop}-->
		</select>
		</td>
	</tr>
	</table>
	</div>
	
	<div class="footactions">
		<input type="submit" name="deletesubmit" value="确定删除" class="submit">
	</div>

<!--{else}-->

	<form method="post" action="admincp.php?ac=profield&fieldid=$thevalue[fieldid]">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">

<!--{if empty($thevalue)}-->
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr>
			<th>栏目</th>
			<th>填写类型</th>
			<th>显示顺序</th>
			<th width="80">操作</th>
		</tr>
		<!--{loop $list $value}-->
		<tr>
			<th>$value[title]</th>
			<td>{$_TPL[formtypes][$value[formtype]]}</td>
			<td><input type="text" name="displayorder[{$value[fieldid]}]" value="$value[displayorder]" size="5"></td>
			<td width="80">
			<a href="admincp.php?ac=profield&op=edit&fieldid=$value[fieldid]">编辑</a> | 
			<a href="admincp.php?ac=profield&op=delete&fieldid=$value[fieldid]">删除</a></td>
		</tr>
		<!--{/loop}-->
		</table>
	</div>
	
	<div class="footactions">
		<input type="submit" name="ordersubmit" value="更新排序" class="submit">
	</div>
	
	</form>
	
<!--{else}-->

	<script language="javascript">
		function formtypeShow(value) {
			if(value != 'select') {
				$('tb_inputnum').style.display = '';
				$('tb_choice').style.display = (value=='text'?'none':'');
			} else {
				$('tb_inputnum').style.display = 'none';
				$('tb_choice').style.display = '';
			}
		}
	</script>
		
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr><th style="width:15em;">栏目名称</th><td><input type="text" name="title" value="$thevalue[title]"></td></tr>
		<tr><th>简单介绍</th><td><input type="text" name="note" value="$thevalue[note]" size="60"></td></tr>
		<tr><th>群组添加表单类型</th><td>
			<select name="formtype" onchange="formtypeShow(this.value)">
			<option value="text"$formtypearr[text]>文本输入框</option>
			<option value="select"$formtypearr[select]>单选列表框</option>
			<option value="multi"$formtypearr[multi]>多选列表框</option>
			</select>
		</td></tr>

		<tbody id="tb_inputnum"<!--{if $thevalue[formtype]=='select'}--> style="display:none;"<!--{/if}-->>
		<tr><th>用户可加入群组最多个数</th><td><input type="text" name="inputnum" value="$thevalue[inputnum]" size="5"></td></tr>
		</tbody>
	
		<tbody id="tb_choice"<!--{if $thevalue[formtype]=='text'}--> style="display:none;"<!--{/if}-->>
		<tr><th>可选值</th><td><textarea name="choice" rows="5" cols="20">$thevalue[choice]</textarea>
			<br />每行一个值，例如输入:<br />北京<br />上海</td></tr>
		</tbody>
	
		<tr>
			<th>群组讨论区人数下限</th>
			<td><input type="text" name="mtagminnum" value="$thevalue[mtagminnum]" size="5"> 当群组的成员数达到该数目时，才允许成员在群组内发话题和回帖。</td>
		</tr>
		<tr>
			<th>群组群主手工指定</th>
			<td>
				<input type="radio" name="manualmoderator" value="1"<!--{if $thevalue[manualmoderator] == 1}--> checked<!--{/if}-->>手工
				<input type="radio" name="manualmoderator" value="0"<!--{if $thevalue[manualmoderator] != '1'}--> checked<!--{/if}-->>自动
				<br>如果选择不手工指定，则系统会自动将第一次使用某个群组的用户作为群主。</td>
		</tr>
		<tr>
			<th>群组成员可由群主控制</th>
			<td>
				<input type="radio" name="manualmember" value="1"<!--{if $thevalue[manualmember] == 1}--> checked<!--{/if}-->>群主可控制
				<input type="radio" name="manualmember" value="0"<!--{if $thevalue[manualmember] != '1'}--> checked<!--{/if}-->>会员可自由加入
				<br>群主可控制，则允许群主有权设置群组的会员加入方式，来控制加入群组的会员。</td>
		</tr>
		<tr><th>显示顺序</th><td><input type="text" name="displayorder" value="$thevalue[displayorder]" size="5"></td></tr>
		</table>
	</div>
		
	<div class="footactions">
		<input type="submit" name="fieldsubmit" value="提交" class="submit">
	</div>
	
	</form>
<!--{/if}-->

<!--{/if}-->

</div>
</div>

<div class="side">
	<!--{template admin/tpl/side}-->
</div>

<!--{template admin/tpl/footer}-->